Telegram Group & Telegram Channel
Python dasturlash maktabi
⭕️ 3-bo'lim "Nazorat tarkibi" ————————————— Ⓜ️ "if" va "elif" operatorlari Biror shart bajarish uchun if operatorlaridan foydalanishingiz mumkin va shart operatori deyarli barcha dasturlarda ishtirok etadi. Shart operatori 3 qismdan iborat (if, elif, else).…
Ⓜ️ Roʼyxat

Ro'yxat - ma'lumotlar to'plamini saqlash uchun ishlatiladigan ma'lumot turi.

To'rtburchakli qavs ichida ro'yxat yaratilganda uning barcha elementlari vergul bilan ajratilib yoziladi. ['olma', 'anor', 'gilos']

Ro'yxat massivga o'xshaydi va farqi shundaki massiv o'zida butun va haqiqiy sonlarni saqlaydi, ro'yxat esa boshqa turdagi ma'lumotlarni ham o'zida saqlashi mumkkin.

list() funksiyasi, literallar yoki ro'yxat gneratorlari yordamida ro'yxatlarni tuzish mumkin.

list_funksiyasi = list('pythonuz')
print(list_funksiyasi)
['p', 'y', 't', 'h', 'o', 'n', 'u', 'z']

literal = ['p', 'y', 't', 'h', 'o', 'n']
print(literal)
['p', 'y', 't', 'h', 'o', 'n']

royxat_gneratori = [ord(i) for i in 'pythonuz']
print(royxat_gneratori)
[112, 121, 116, 104, 111, 110, 117, 122]

none = list()
print(none)
[] # boʻsh roʻyxat

Ro'yxat bo'laklari

Ro'yxat bo'laklari ro'yxatdan qiymatlarni olishning yanada rivojlangan usulini taqdim etadi. Ro'yxatni qismlarga ajratish ikki nuqta bilan ajratilgan butun sonlar bilan indekslanadi.

# indeks 0, 1, 2, 3, 4, 5, 6, 7
squares = [4, 9, 16, 25, 36, 49, 64, 81]

2-elelmentdan 6-elementgacha bo'lgan elementlarni chop qiladi.
print(squares[2:6])
[16, 25, 36, 49]

3-elelmentdan 8-elementgacha bo'lgan elementlarni chop qiladi.
print(squares[3:8])
[25, 36, 49, 64, 81]

0-elelmentdan 1-elementgacha bo'lgan elementlarni chop qiladi.
print(squares[0:1])
[4]

4-elementgacha bo'lgan elementlarni chop qiladi.
print(squares[:4])
[4, 9, 16, 25]

4-elelmentdan oxirgi elementgacha bo'lgan elementlarni chop qiladi.
print(squares[4:])
[36, 49, 64, 81]

2 qadam bilan ro'yxatni chop qiladi.Ro'yxatadgi har 2-elementni chop qiladi.
print(squares[::2])
[4, 16, 36, 64]

4-elelmentdan 6-elementgacha bo'lgan har 3-elementlarni chop qiladi.
print(squares[2:6:3])
[16, 49]

Manfiy indeks ro'yxatning oxiridan boshlab hisoblash uchun xizmat qiladi.
1-elelmentdan 7-elementgacha bo'lgan elementlarni chop qiladi.
print(squares[1:-1])
[9, 16, 25, 36, 49, 64]

1-elelmentdan 5-elementgacha bo'lgan elementlarni chop qiladi.
print(squares[1:-3])
[9, 16, 25, 36]

Ro'yxat o'zgarmaydi.Ro'yxatni teskari tartibda chop qiladi.
print(squares[::-1])
[81, 64, 49, 36, 25, 16, 9, 4]

Ro'yxat o'zgaradi.Ro'yxatni teskari tartibda chop qiladi.
squares.reverse()
print(squares)
[81, 64, 49, 36, 25, 16, 9, 4]

@pythonuz



tg-me.com/pythonuz/367
Create:
Last Update:

Ⓜ️ Roʼyxat

Ro'yxat - ma'lumotlar to'plamini saqlash uchun ishlatiladigan ma'lumot turi.

To'rtburchakli qavs ichida ro'yxat yaratilganda uning barcha elementlari vergul bilan ajratilib yoziladi. ['olma', 'anor', 'gilos']

Ro'yxat massivga o'xshaydi va farqi shundaki massiv o'zida butun va haqiqiy sonlarni saqlaydi, ro'yxat esa boshqa turdagi ma'lumotlarni ham o'zida saqlashi mumkkin.

list() funksiyasi, literallar yoki ro'yxat gneratorlari yordamida ro'yxatlarni tuzish mumkin.

list_funksiyasi = list('pythonuz')
print(list_funksiyasi)
['p', 'y', 't', 'h', 'o', 'n', 'u', 'z']

literal = ['p', 'y', 't', 'h', 'o', 'n']
print(literal)
['p', 'y', 't', 'h', 'o', 'n']

royxat_gneratori = [ord(i) for i in 'pythonuz']
print(royxat_gneratori)
[112, 121, 116, 104, 111, 110, 117, 122]

none = list()
print(none)
[] # boʻsh roʻyxat

Ro'yxat bo'laklari

Ro'yxat bo'laklari ro'yxatdan qiymatlarni olishning yanada rivojlangan usulini taqdim etadi. Ro'yxatni qismlarga ajratish ikki nuqta bilan ajratilgan butun sonlar bilan indekslanadi.

# indeks 0, 1, 2, 3, 4, 5, 6, 7

squares = [4, 9, 16, 25, 36, 49, 64, 81]

2-elelmentdan 6-elementgacha bo'lgan elementlarni chop qiladi.
print(squares[2:6])
[16, 25, 36, 49]

3-elelmentdan 8-elementgacha bo'lgan elementlarni chop qiladi.
print(squares[3:8])
[25, 36, 49, 64, 81]

0-elelmentdan 1-elementgacha bo'lgan elementlarni chop qiladi.
print(squares[0:1])
[4]

4-elementgacha bo'lgan elementlarni chop qiladi.
print(squares[:4])
[4, 9, 16, 25]

4-elelmentdan oxirgi elementgacha bo'lgan elementlarni chop qiladi.
print(squares[4:])
[36, 49, 64, 81]

2 qadam bilan ro'yxatni chop qiladi.Ro'yxatadgi har 2-elementni chop qiladi.
print(squares[::2])
[4, 16, 36, 64]

4-elelmentdan 6-elementgacha bo'lgan har 3-elementlarni chop qiladi.
print(squares[2:6:3])
[16, 49]

Manfiy indeks ro'yxatning oxiridan boshlab hisoblash uchun xizmat qiladi.
1-elelmentdan 7-elementgacha bo'lgan elementlarni chop qiladi.
print(squares[1:-1])
[9, 16, 25, 36, 49, 64]

1-elelmentdan 5-elementgacha bo'lgan elementlarni chop qiladi.
print(squares[1:-3])
[9, 16, 25, 36]

Ro'yxat o'zgarmaydi.Ro'yxatni teskari tartibda chop qiladi.
print(squares[::-1])
[81, 64, 49, 36, 25, 16, 9, 4]

Ro'yxat o'zgaradi.Ro'yxatni teskari tartibda chop qiladi.
squares.reverse()
print(squares)
[81, 64, 49, 36, 25, 16, 9, 4]

@pythonuz

BY Python dasturlash maktabi


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/pythonuz/367

View MORE
Open in Telegram


Python dasturlash maktabi Telegram | DID YOU KNOW?

Date: |

Export WhatsApp stickers to Telegram on Android

From the Files app, scroll down to Internal storage, and tap on WhatsApp. Once you’re there, go to Media and then WhatsApp Stickers. Don’t be surprised if you find a large number of files in that folder—it holds your personal collection of stickers and every one you’ve ever received. Even the bad ones.Tap the three dots in the top right corner of your screen to Select all. If you want to trim the fat and grab only the best of the best, this is the perfect time to do so: choose the ones you want to export by long-pressing one file to activate selection mode, and then tapping on the rest. Once you’re done, hit the Share button (that “less than”-like symbol at the top of your screen). If you have a big collection—more than 500 stickers, for example—it’s possible that nothing will happen when you tap the Share button. Be patient—your phone’s just struggling with a heavy load.On the menu that pops from the bottom of the screen, choose Telegram, and then select the chat named Saved messages. This is a chat only you can see, and it will serve as your sticker bank. Unlike WhatsApp, Telegram doesn’t store your favorite stickers in a quick-access reservoir right beside the typing field, but you’ll be able to snatch them out of your Saved messages chat and forward them to any of your Telegram contacts. This also means you won’t have a quick way to save incoming stickers like you did on WhatsApp, so you’ll have to forward them from one chat to the other.

That strategy is the acquisition of a value-priced company by a growth company. Using the growth company's higher-priced stock for the acquisition can produce outsized revenue and earnings growth. Even better is the use of cash, particularly in a growth period when financial aggressiveness is accepted and even positively viewed.he key public rationale behind this strategy is synergy - the 1+1=3 view. In many cases, synergy does occur and is valuable. However, in other cases, particularly as the strategy gains popularity, it doesn't. Joining two different organizations, workforces and cultures is a challenge. Simply putting two separate organizations together necessarily creates disruptions and conflicts that can undermine both operations.

Python dasturlash maktabi from ru


Telegram Python dasturlash maktabi
FROM USA